package com.fx.controller;

import com.fx.pojo.User;
import com.fx.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("/list")
    public Object list(){
        return  userService.findList();
    }

    @PostMapping("/add")
    public int add(@RequestBody User user){
        return userService.add(user);
    }

    @PutMapping("/update")
    public int update(@RequestBody User user){
        return userService.update(user);
    }
}
